from django.urls import path
from . import views

app_name = 'luck'

#   用户模块
urlpatterns = [
    #   登录 /account/logins/
    #   注销 /account/logouts/
    #   注册 /account/register/
    #   修改密码 /account/change_password/
    #   充值页面 /account/recharge/
    #   充值记录 /account/recharge/history/
    #   订单记录 /account/order/self/

    path('account/register/', views.register, name='register'),
    path('account/logouts/', views.logouts, name='logouts'),
    path('account/logins/', views.logins, name='logins'),
    path('account/change_password/', views.change_password, name='change_password'),
    path('account/recharge/', views.recharge, name='recharge'),
    path('account/recharge/history/', views.recharge_history, name='recharge_history'),
    path('account/order/self/', views.order_self, name='order_self'),
]

#   返回总列表
urlpatterns += [
    path('account/list/', views.list, name='list')
]

#   商品模块
urlpatterns += [
    #   商品总列表
    path('commodity/', views.commodity, name='commodity'),
    #   指定类别商品列表
    path('commodity/category/', views.category_id, name='category_id'),
    #   指定商品详情页面
    path('commodity/<int:commodity_no>', views.commodity_no, name='commodity_no'),
]


#   下订单
urlpatterns += [
    path('commodity/add_order/', views.add_order, name='add_order')
]

#   中奖
urlpatterns += [
    path('/order/is_good/<commodity_no>', views.is_good, name='is_good')
]